package com.daify.threadlearn.chapter01.order04;

import java.util.Vector;

/**
 * @author daify
 * @date 2019-06-05
 */
public class VectorError {

    public static Object getLast (Vector list) {
        synchronized (list) {
            int i = list.size() - 1;
            return list.get(i);
        }
    }

    public static Object deleteLast (Vector list) {
        synchronized (list) {
            int i = list.size() - 1;
            return list.remove(i);
        }
    }
}
